{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <div class="col-sm-12">
                <div class="tabs-container">

                    <div class="tab-content">
                        <div class="ibox-content">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">男用户ID（下级）：</label>
                                <div class="col-sm-9">
                                    <input name="userid" type="number" class="form-control" value="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">女用户ID（上级）：</label>
                                <div class="col-sm-9">
                                    <input name="touserid" type="number" class="form-control" value="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">绑定前充值(金币)：</label>
                                <div class="col-sm-9">
                                    <input id="chongzhi" type="number" class="form-control" disabled value="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">绑定前会员充值应补(积分)：</label>
                                <div class="col-sm-9">
                                    <input id="commission_chongzhi" type="number" class="form-control" disabled value="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">绑定前会员充值(rmb)：</label>
                                <div class="col-sm-9">
                                    <input id="huiyuan" type="number" class="form-control" disabled value="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">绑定前会员充值应补(积分)：</label>
                                <div class="col-sm-9">
                                    <input id="commission_huiyuan" type="number" class="form-control" disabled value="">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">说明：</label>
                                <div class="col-sm-9">
                                    <p style="color:red;">此工具只计算绑定前【1天】内的充值补发收益，充值金币按照用户角色确定分佣比例，会员充值分佣比例为80%。</p>
                                    <p style="color:red;">计算数值务必结合充值管理等项进行核对。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="public/footer" /}
{load href="__PLUGINS__iCheck/icheck.min.js"}
{load href="__PLUGINS__iCheck/custom.css"}
{load href="__JS__xlsx.core.min.js"}
<script type="text/javascript">
    $(document).ready(function(){
        $("#button").click(function(){
            ajaxFun("POST","",$(".form-horizontal").serialize(),"json",function(res){
                if(res){
                    layer.msg(res.err ? res.err : '查询成功')
                    $('#chongzhi').val(res.ret?res.ret.chongzhi:'');
                    $('#huiyuan').val(res.ret?res.ret.huiyuan:'');
                    $('#commission_chongzhi').val(res.ret?res.ret.commission_chongzhi:'');
                    $('#commission_huiyuan').val(res.ret?res.ret.commission_huiyuan:'');
                }else{
                    swal_msg("错误",res,"error");
                }
            });
        });
        $("#button2").click(function(){
            layer.open({
                title: '是否确认发放？',
                content: '是否确认发放？',
                btn: ['确定', '取消'],
                yes: function (index, layero) {
                    ajaxFun("POST","{:url('bind')}",$(".form-horizontal").serialize(),"json",function(res){
                        //console.log(res)
                        if(res){
                            layer.msg(res.ret ? res.ret : '查询成功')
                        }else{
                            swal_msg("错误",res,"error");
                        }
                    });
                }
            })
        });
    });

</script>

<style type="text/css">
.tbutton{ 
  display: flex;
  justify-content: space-around;
  position: fixed;
  top:390px;
  width: 100%;
  background: #fff;
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px solid #F5EFEF;
  z-index: 1
}
#button{ width:120px; }
.wrapper-content{ padding-bottom:500px;margin-bottom: 75px;}
</style>

<div class="tbutton">
  <div id="button"><button class="btn btn-w-m btn-primary" type="button"><i class="fa fa-search"></i> 查询</button></div>
  <!--<div id="button2"><button class="btn btn-w-m btn-primary" type="button"><i class="fa fa-check"></i> 发放</button></div>-->
</div>
